hh = {}
function hh.writetrack(trknum)
  msq.tick(0)
  msq.program_change(msq.tick(), 1,"contrabass")
  print(msq.tick())
  msq.note(msq.tick(), 1,"w","C4",100)
  print(msq.tick())
  msq.program_change(msq.tick(), 1,"acousticbass")
  print(msq.tick())
  msq.note(msq.tick(), 1,"q.","D4",100)
  print(msq.tick())
  msq.program_change(msq.tick(), 1,"contrabass")
  print(msq.tick())
  msq.note(msq.tick(), 1,"q","E5",100)
  print(msq.tick())
  msq.note(msq.tick(), 1,"q","F5",100)
  print(msq.tick())
  msq.program_change(msq.tick(), 1,"fxcrystal")
  print(msq.tick())
  msq.note(msq.tick(), 1,"q","F5",100)
  print(msq.tick())
  msq.note(msq.tick(), 1,"e","F5",100)
  print(msq.tick())
  msq.program_change(msq.tick(), 1 ,25)
  print(msq.tick())
  msq.note(msq.tick(), 1,"s","F5",100)
  print(msq.tick())
  msq.note(msq.tick(), 1,"t","F5",100)
  print(msq.tick())
  msq.note(msq.tick(), 1,"q","tom1",100)
  print(msq.tick())
  msq.note(msq.tick(), 1,"q","tom2",100)
  print(msq.tick())
  msq.note(msq.tick(), 1,"q","tom3",100)
  print(msq.tick())
  msq.note(msq.tick(), 1,"q","tom4",100)
  print(msq.tick())
  msq.note(msq.tick(), 1,"q","tom5",100)
  print(msq.tick())
  msq.note(msq.tick(), 1,"q","tom6",100)
  print(msq.tick())
  msq.note(msq.tick(), 1,"q","tom6",100)
  print(msq.tick())

  return 480;
end

function hh.error(err,errmsg)
  print("Error:",err,errmsg)
end

msq.write(arg[1] or "untitled.mid", 0, 1, 480, hh)


